(function(angular) {
	'use strict';
	angular.module('fs.waf').factory('serviceService', serviceService);
	serviceService.$inject = [ '$q', 'loggerFactory', 'commonService' ];
	function serviceService($q, loggerFactory, commonService) {
		var log = loggerFactory.getLogger("serviceService");
		function dateDisabled(dateModel) {
			var date = dateModel.date, mode = dateModel.mode;
			return mode === 'day' && commonService.isHoliday(date);
		}
		function getServiceTypeOptions() {
			var data = [ {
				"label" : "label.service.both",
				"value" : "B"
			}, {
				"label" : "label.service.internal",
				"value" : "I"
			}, {
				"label" : "label.service.external",
				"value" : "E"
			}];
			return data;
		}
		function getServiceStatusOptions() {
			var data =  [ {
				"label" : "label.service.active",
				"value" : "A"
			}, {
				"label" : "label.service.inactive",
				"value" : "I"
			}];
			return data;
		}
		function getSiteCodeOptions() {
			var options = {
				"callback" : {
					"changed" : "vm.siteCodeChanged"
				},
				"data" : [ {
					"label" : "MD BANK",
					"value" : "MDBANK"
				}, {
					"label" : "BANK 01",
					"value" : "BANK01"
				}, {
					"label" : "BANK 02",
					"value" : "BANK02"
				}, {
					"label" : "BANK 03",
					"value" : "BANK03"
				}, {
					"label" : "BANK 04",
					"value" : "BANK04"
				} ]
			};
			return options;
		}
		function getCompanyTypeOptions() {
			var options = {
				"callback" : {
					"changed" : "vm.siteCodeChanged"
				},
				"data" : [ {
					"value" : "EXPORTER",
					"label" : "label.company.seller"
				}, {
					"value" : "IMPORTER",
					"label" : "label.company.buyer"
				}, {
					"value" : "GUARANTEE",
					"label" : "label.company.guarantee"
				} ]
			};
			return options;
		}
		function getCompanyTypeLookupOptions() {
			var options = {
				"callback" : {
					"changed" : "vm.siteCodeChanged"
				},
				"id" : "cda.companyType",
				"params" : {
					"paramName1" : "<siteCode",
					"paramName2" : "fixedValue",
				},
				"boundTo" : {
					"companyType" : "companyType2"
				},
				"okEvent" : true,
				"cancelEvent" : false
			};
			return options;
		}
		function getSensitiveOptions() {
			var options = {
				"callback" : {
					"changed" : "vm.siteCodeChanged"
				},
				"mask" : true,
				"positiveOffset" : 2,
				"negativeOffset" : 3
			};
			return options;
		}
		function getCcyOptions() {
			var options = {
				"callback" : {
					"changed" : "vm.siteCodeChanged"
				},
				"data" : [ {
					"label" : "CNY",
					"value" : "CNY"
				}, {
					"label" : "USD",
					"value" : "USD"
				} ]
			};
			return options;
		}
		return {
			dateDisabled : dateDisabled,
			getSiteCodeOptions : getSiteCodeOptions,
			getCompanyTypeOptions : getCompanyTypeOptions,
			getCompanyTypeLookupOptions : getCompanyTypeLookupOptions,
			getSensitiveOptions : getSensitiveOptions,
			getCcyOptions : getCcyOptions,
			getServiceStatusOptions : getServiceStatusOptions,
			getServiceTypeOptions : getServiceTypeOptions
		};
	}
})(angular);